// MESSAGE FO_GYRO support class

#pragma once

namespace mavlink {
namespace fppa {
namespace msg {

/**
 * @brief FO_GYRO message
 *
 * fiber optic gyroscope. 
 */
struct FO_GYRO : mavlink::Message {
    static constexpr msgid_t MSG_ID = 34;
    static constexpr size_t LENGTH = 20;
    static constexpr size_t MIN_LENGTH = 20;
    static constexpr uint8_t CRC_EXTRA = 228;
    static constexpr auto NAME = "FO_GYRO";


    int32_t state; /*<  state. */
    std::array<float, 3> wib; /*<  wib. */
    float temprature; /*<  temprature. */


    inline std::string get_name(void) const override
    {
            return NAME;
    }

    inline Info get_message_info(void) const override
    {
            return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
    }

    inline std::string to_yaml(void) const override
    {
        std::stringstream ss;

        ss << NAME << ":" << std::endl;
        ss << "  state: " << state << std::endl;
        ss << "  wib: [" << to_string(wib) << "]" << std::endl;
        ss << "  temprature: " << temprature << std::endl;

        return ss.str();
    }

    inline void serialize(mavlink::MsgMap &map) const override
    {
        map.reset(MSG_ID, LENGTH);

        map << state;                         // offset: 0
        map << wib;                           // offset: 4
        map << temprature;                    // offset: 16
    }

    inline void deserialize(mavlink::MsgMap &map) override
    {
        map >> state;                         // offset: 0
        map >> wib;                           // offset: 4
        map >> temprature;                    // offset: 16
    }
};

} // namespace msg
} // namespace fppa
} // namespace mavlink
